package com.homework.ch05;

class Teacher {
    // 显式初始化
    private String name;
    private int age;
    private String gender = "男";

    // 将private改为public，允许外部类调用
    public void show() {
        String name = "tom";
        int age = 20;

        System.out.println("name: " + name);
        System.out.println("age: " + age);
        System.out.println("gender: " + gender);
    }

    public void disp() {
        String name = "jack";
        int age = 18;

        System.out.println("this.age: " + this.age);
        System.out.println("this.name: " + this.name);
        System.out.println("this.gender: " + this.gender);
    }
}